<template>
  <div>
    <van-cell title="分享" @click="showShare = true" />
<van-share-sheet
  v-model:show="showShare"
  title="立即分享给好友"
  :options="options"
  @select="onSelect"
/>
    <img :src="v.url" alt="" width="100%" />
    <h3>{{ v.title }}</h3>
    <p>{{ v.name }}</p>
  </div>
</template>

<script setup>
import { useRoute } from "vue-router";
import { ref } from "vue";
let route = new useRoute();

console.log("route");
const v = route.query;
  const showShare = ref(false);
    const options = [
      { name: '微信', icon: 'wechat' },
      { name: '微博', icon: 'weibo' },
      { name: '复制链接', icon: 'link' },
      { name: '分享海报', icon: 'poster' },
      { name: '二维码', icon: 'qrcode' },
    ];

    const onSelect = (option) => {
      showToast(option.name);
      showShare.value = false;
    };

</script>
 
<style>
</style>